// Coded by Shambler (Shambler@OldUnreal.com, Shambler__@Hotmail.com, ICQ: 108730864) and portal effects by Fuegerstef
Class pgPortalGun extends KFWeaponShotgun;

#EXEC OBJ LOAD FILE="..\Textures\portaltestT.utx"
#EXEC OBJ LOAD FILE="PortalGunSnd.uax"

var pgPortalDecal Portals[2];
var Texture CrosshairTex;

simulated function RenderOverlays( Canvas Canvas )
{
	local float CrosshairScale;

	CrosshairScale = FClamp(Canvas.ClipY/1300.f,0.25f,1.f);
	Canvas.Style = ERenderStyle.STY_Alpha;
	Canvas.SetPos((Canvas.ClipX-CrosshairTex.USize*CrosshairScale)*0.5,(Canvas.ClipY-CrosshairTex.VSize*CrosshairScale)*0.5);
	Canvas.DrawIcon(CrosshairTex,CrosshairScale);
	Canvas.Style = ERenderStyle.STY_Normal;
	Super.RenderOverlays(Canvas);
}

simulated function bool HasAmmo()
{
	return True;
}

final function KillPortals( optional bool bSound )
{
	local byte i;
	local bool bFound;

	for( i=0; i<2; ++i )
		if( Portals[i]!=None )
		{
			bFound = bSound;
			Portals[i].Destroy();
		}
	if( bFound && Instigator!=None )
		Instigator.PlaySound(Sound'portal_fizzle',SLOT_Misc,2.f);
}
simulated function Destroyed()
{
	// Remove portals when weapon is destroyed.
	KillPortals();
	Super.Destroyed();
}

defaultproperties
{
     MagCapacity=1
     HudImage=Texture'portaltestT.HUD.pgunselected'
     SelectedHudImage=Texture'portaltestT.HUD.pgselected'
     Weight=0.000000
     StandardDisplayFOV=65.000000
     bModeZeroCanDryFire=True
     SleeveNum=4
     TraderInfoTexture=Texture'portaltestT.HUD.pgTrader'
     PlayerIronSightFOV=70.000000
     ZoomedDisplayFOV=40.000000
     FireModeClass(0)=Class'pgPortalGunFire'
     FireModeClass(1)=Class'pgPortalGunFireB'
     PutDownAnim="PutDown"
     SelectSound=Sound'KF_PumpSGSnd.SG_Select'
     AIRating=0.600000
     CurrentRating=0.600000
     Description="Device created by Aperture labs to create inter-dimensional portals using the power of mini black holes "
     DisplayFOV=65.000000
     Priority=4
     InventoryGroup=5
     GroupOffset=1
     PickupClass=Class'pgPortalGunPickup'
     PlayerViewOffset=(X=20.000000,Y=18.750000,Z=-7.500000)
     BobDamping=7.000000
     AttachmentClass=Class'pgPortalGunAttachment'
     IconCoords=(X1=169,Y1=172,X2=245,Y2=208)
     ItemName="Portal Device"
     Mesh=SkeletalMesh'portaltestA.PortalGunWeapon'
     Skins(0)=Shader'portaltestT.funfinal'
     Skins(1)=Shader'portaltestT.TUBESHADER'
     Skins(2)=Shader'portaltestT.BLShader'
     Skins(3)=FinalBlend'portaltestT.blueGFinal'
     TransientSoundVolume=1.000000
	CrosshairTex=Texture'PortalGunT.PortalCross'
}
